package com.mayuran19.portal.common.database.domain;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;

@Entity(name = "business_organization_user")
public class BusinessOrganizationUser extends DomainObject {
	private Long id;
	private User user;
	private BusinessOrganization businessOrganization;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
	@JoinColumn(name = "user_id")
	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
	@JoinColumn(name = "business_organization_id")
	public BusinessOrganization getBusinessOrganization() {
		return businessOrganization;
	}

	public void setBusinessOrganization(
			BusinessOrganization businessOrganization) {
		this.businessOrganization = businessOrganization;
	}

}
